package com.yzh.design.demo.factory.impl;

import com.yzh.design.demo.factory.ICacheAdapter;
import com.yzh.design.demo.matter.EGM;
import java.util.concurrent.TimeUnit;
public class EGMCacheAdapter implements ICacheAdapter {
    EGM egm = new EGM();
    @Override
    public String get(String key) {
        return egm.gain(key);
    }

    @Override
    public void set(String key, String val) {
        egm.set(key, val);
    }

    @Override
    public void set(String key, String val, long timeout, TimeUnit timeUnit) {
        egm.setEx(key, val, timeout, timeUnit);
    }

    @Override
    public void del(String key) {
        egm.delete(key);
    }
}
